#include<stdio.h>
int main()
{
    int n,i,j,m=0,cnt=0;
    scanf("%d",&n);
    j=n;
    while(j!=0)
    {
        m=m*10+j%10;
        j=j/10;
        cnt++;
    }
    printf("%d\n",cnt);
    i=m;
    while(i!=0)
    {
        printf("%d ",i%10);
        i=i/10;
    }
    //printf("\n");
    printf("\n%d",m);


    return 0;
}